#输出对应字符串，小写输出0，大写输出1
# s = "ScWlkBS"  # --> 1010011
# result = ""
# # for i in s:
# #     if i.isupper():
# #         result += "1"
# #     else:
# #         result +="0"
# # else:
# #     print(result)
#
# for i in s:
#     result += "1" if i.isupper() else "0"
# print(result)

###################用户登录验证##############33
#登录成功/失败都给提醒
#最多可尝试3次


# for i in range(3):
#     name = input("please input your name:")
#     passwd = input("please input your passwd:")
#     if name == "root" and passwd == "123456":
#         print("登录成功!")
#         break
#     else:
#         print(f"登录失败，还有{3-i-1}重试机会")

# num = 90
# for i in range(3):
#     a = input("请输入一个数字：")
#     if a.isnumeric():
#
#         if int(a) > int(num):
#             print(f"大了，还有{3-i-1}次机会")
#         elif int(a) < int(num):
#             print(f"小了，请重新输入一个数字，你还有{3-i-1}次机会")
#         elif int(a) == int(num):
#             print("恭喜你猜对了")
#     else:
#         print(f"请输入数字，不要输入其他的，还有{3-i-1}次机会")
#      #   break
# else:
#     print("游戏结束")

##  1-100的和
# num = 0
# for i in range(100):
#     num += i+1
# print(num)

#找出100-999的水仙花数 range(100,1000)
#153 = 1的3次方 + 5的三次方 + 3的三次方
#三位数， 各个位数的立方和等于该数本身

# print("水仙花数为：")
# for i in range(100,1000):
#     x = str(i)
#     if i == int(x[0])**3+int(x[1])**3+int(x[2])**3:
#         print(i)
#
# for i in range(100,1000):  #i = 153
#     a = i // 100           #
#     b = i % 100 // 10
#     c = i % 10
#     if i ==a**3+b**3+c**3 :
#         print("水仙花数：",i)

#############九九乘法表############
for i in range(1,10):
    for j in range(1, i+1):
        print(f"{j} * {i} = {i*j}", end=" ")
    print()
